using System.Collections;
using System.Collections.Generic;
using UnityEngine;

namespace ZSW.Framework
{
    public class ZSWF_RenderQueue : ZSWF_InitMonoBehaviour
    {
        // RT
        public RenderTexture rt;
        public int rtWidth = 2560;
        public int rtHeight = 1440;

        // Camera
        public Camera cam;

        // Materials
        public Material mat2;

        private void OnPreRender()
        {
            rt = RenderTexture.GetTemporary(rtWidth, rtHeight, 16);
            cam.targetTexture = rt;
        }

        private void OnPostRender()
        {
            cam.targetTexture = null;
            Graphics.Blit(rt, null, mat2);
            RenderTexture.ReleaseTemporary(rt);
        }
    }

}
